# Contributor: Antoni Aloy <aaloytorrens@gmail.com>
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Antoni Aloy <aaloytorrens@gmail.com>
pkgname=solaar
pkgver=1.1.10
pkgrel=2
pkgdesc="Linux device manager for a wide range of Logitech devices"
url="https://pwr-solaar.github.io/Solaar/"
arch="noarch"
license="GPL-2.0-or-later"
depends="
	py3-dbus
	py3-evdev
	py3-hid-parser
	py3-psutil
	py3-udev
	py3-xlib
	py3-yaml
	"
_depends_gui="
	gtk+3.0
	hicolor-icon-theme
	libnotify
	py3-gobject3
	"
makedepends="
	$_depends_gui
	gettext
	py3-setuptools
	"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-lang $pkgname-gui $pkgname-pyc"
source="https://github.com/pwr-Solaar/Solaar/archive/$pkgver/solaar-$pkgver.tar.gz
	udev-rules.patch
	solaar-gui.patch
	"
builddir="$srcdir/Solaar-$pkgver"
options="!check" # no tests provided by upstream

build() {
	python3 setup.py build

	./tools/po-compile.sh
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

gui() {
	pkgdesc="$pkgdesc (Gtk GUI)"
	depends="$_depends_gui"
	install_if="$pkgname=$pkgver-r$pkgrel gtk+3.0"

	amove usr/lib/python3*/site-packages/solaar/ui
	amove usr/share
}

sha512sums="
318df123f755105dc4e5c403a0eacc1e69b9042e01b3f0e403c49516276c4bf16b6a783b5bdcfa11f0b0670dcd1dd02b9d0ae928517e1965966614ab479b7e00  solaar-1.1.10.tar.gz
93e34c95b776ad8bef4c8282441256595ceb5ed00be198ff10501b82de495444f5185914013e6524acf102bc8baa94790d2db88737c791ccdb63e358315748bd  udev-rules.patch
4aedd8ca49c8dec25ac649ef0c00a75da4e56235fa030141c5191df11f7ae71a2d17f3f129f0f86c0b61a2670bd58f0cf512f2cae0bdef50bec9cfb8efeaf2dd  solaar-gui.patch
"
